Hello and welcome. In this part you will
explore using explainers. You can use the Azure Machine Learning SDK
to create explainers for models. Even if they were not trained using
an Azure Machine Learning experiment. To interpret a local model, you must
install the azureml-interpret package and use it to create an explainer. There are multiple types of
explainer including MimicExplainer, TabularExplainer and PFIExplainer. Let's look at these in
a little more detail now. MimicExplainer is an explainer that
creates a global surrogate model that approximates your trained model, and
can be used to generate explanations. This explainable model must have
the same kind of architecture as you're trained model, for example,
linear or tree-based. TabularExplainer is an explainer that
acts as a wrapper around various sharp explainer algorithms. Automatically choosing the one
that is most appropriate for your model architecture. PFIExplainer is a permutation
feature importance explainer, that analyzes feature importance. By shuffling feature values and measuring
the impact on prediction performance. Okay, let's switch to global
feature importance now. To retrieve global importance values for
the features in your model, you can call the explained global method of your
explainer to get a global explanation. And then use the
get_feature_importance_dict() method to get a dictionary of
the feature importance values. It's important to note that the code
is the same for MimicExplainer and TabularExplainer. The PFIExplainer requires the actual
labels that correspond to the test features. Finally, let's look at explaining
local feature importance. To retrieve local feature importance from
a MimicExplainer or a TabularExplainer. You must call the explained local method
of your explainer specifying the subset of cases you want to explain. Then you can use
the get_ranked_local_names and get_ranked_local_values methods. To retrieve dictionaries
of the feature names and importance values ranked by importance. It's important to note that the code
is the same for MimicExplainer and TabularExplainer. The PFIExplainer doesn't support local
feature importance explanations.